<template>
  <div id="second-nav">
    <el-menu
      class="el-menu-vertical-demo"
      ref="secondNav"
      :router="true"
      :default-active="$route.path"
      :unique-opened="uniqueOpened"
      @open="handleOpen"
      @close="handleClose"
      @select="handleSelect"
    >
      <secondNavItem :treeData="navList"></secondNavItem>
    </el-menu>
  </div>
</template>

<script>
import secondNavItem from "./secondNavItem";
export default {
  components: { secondNavItem },
  name: "secondNav",
  props: {
    uniqueOpened: {
      type: Boolean,
      default: false,
    },
    navList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    defaultOpeneds: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  data() {
    return {};
  },
  created() {},
  methods: {
    handleOpen(index) {},
    handleClose() {},
    handleSelect(path) {
      if (!path) {
        path = "/404";
      }
      //this.$router.push({ path: path });
    },
  },
};
</script>

<style lang="less">
#secondNav {
  height: 100%;
}
.el-menu {
  border-right: none;
  margin-top: 20px;
}
.el-menu--inline {
  margin-top: 0;
}
</style>